I recently came across a logger declared as below:
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
Is there an advantage to declaring the logger in this manner as opposed to declaring it 'normally' like this:
`private static final Logger logger = LoggerFactory.getLogger(MyClass.class`);
Using MethodHandles.lookup().lookupClass() avoids embedding the class name, which will often be wrong when the line is copyed and pasted.